/*     */ package my.rummyInterface;
/*     */ 
/*     */ import java.awt.BorderLayout;
/*     */ import java.awt.Color;
/*     */ import java.awt.Dimension;
/*     */ import java.awt.Font;
/*     */ import java.awt.GridLayout;
/*     */ import java.awt.event.ActionEvent;
/*     */ import java.awt.event.ActionListener;
/*     */ import java.io.BufferedReader;
/*     */ import java.io.FileReader;
/*     */ import java.io.IOException;
/*     */ import java.util.ArrayList;
/*     */ import javax.swing.JButton;
/*     */ import javax.swing.JFrame;
/*     */ import javax.swing.JLabel;
/*     */ import javax.swing.JPanel;
import javax.swing.JTextArea;
/*     */ 
/*     */ public class PanelInformacion extends JFrame
/*     */   implements ActionListener
/*     */ {
	/*     */   private static final long serialVersionUID = 1L;
	/*     */   private RummyInterface principal;
	/*     */   private JTextArea informacion;
	/*     */   private JButton ok;
	/*     */ 
	/*     */   public PanelInformacion(RummyInterface principalP, int ent)
	/*     */     throws IOException
	/*     */   {
		/*  46 */     this.principal = principalP;
		/*     */ 
		/*  49 */     setDefaultCloseOperation(1);
		/*  50 */     setSize(430, 444);
		/*  51 */     setTitle("Informacion");
		/*  52 */     setResizable(true);
		/*  53 */     setLocationRelativeTo(null);
		/*     */ 
		/*  56 */     setLayout(new BorderLayout());
		/*     */ 
		/*  59 */     JPanel panelInfo = new JPanel();
		/*  60 */     ArrayList<String> a = read(ent);
		/*  61 */     this.informacion = new JTextArea(1, a.size());
		/*  62 */     for (int i = 0; i < a.size(); i++)
		/*     */     {
			/*  64 */       String as = (String)a.get(i);
			/*  65 */       this.informacion.append(as);
		/*     */     }
		/*  67 */     this.informacion.setEditable(false);
		/*  68 */     this.informacion.setBackground(new Color(245, 245, 245));
		/*  69 */     this.informacion.setFont(new Font("Arial", 0, 14));
		/*  70 */     this.informacion.setPreferredSize(new Dimension(410, 400));
		/*  71 */     this.informacion.setLineWrap(true);
		/*  72 */     this.informacion.setWrapStyleWord(true);
		/*  73 */     panelInfo.add(this.informacion);
		/*  74 */     add(panelInfo, "Center");
		/*     */ 
		/*  76 */     JLabel label = new JLabel();
		/*  77 */     JLabel label2 = new JLabel();
		/*  78 */     JPanel panelOK = new JPanel();
		/*  79 */     panelOK.setLayout(new GridLayout(1, 3));
		/*  80 */     panelOK.add(label);
		/*  81 */     this.ok = new JButton("OK");
		/*  82 */     this.ok.addActionListener(this);
		/*  83 */     this.ok.setActionCommand("OK");
		/*  84 */     panelOK.add(this.ok);
		/*  85 */     panelOK.add(label2);
		/*  86 */     add(panelOK, "South");
	/*     */   }
	/*     */ 
	/*     */   public void actionPerformed(ActionEvent e)
	/*     */   {
		/*  93 */     String comando = e.getActionCommand();
		/*  94 */     if (comando.equals("OK"))
		/*     */     {
			/*  96 */       this.principal.cerrarInformacion();
		/*     */     }
	/*     */   }
	/*     */ 
	/*     */   public ArrayList<String> read(int ent)
	/*     */   {
		/* 103 */     ArrayList<String> text = new ArrayList<String>();
		/*     */     try
		/*     */     {
			/*     */	String add;
			/*     */	if( ent == 0){
				/* 107 */       add = "data\\informacion\\informacion.txt";}
			/*     */	else{
				/*     */		add = "data\\informacion\\info.txt";}
			/* 108 */       FileReader fread = new FileReader(add);
			/* 109 */       BufferedReader br = new BufferedReader(fread);
			/* 110 */       String text1 = "";
			/* 111 */       while ((text1 = br.readLine()) != null)
			/*     */       {
				/* 113 */         text.add(text1 + "\n");
			/*     */       }
			/* 115 */       br.close();
		/*     */     }
		/*     */     catch (Exception ioe) {
			/* 118 */       ioe.printStackTrace();
		/*     */     }
		/* 120 */     return text;
	/*     */   }
/*     */ }

/* Location:           C:\Users\Yank\Documents\APO\Rummy\bin\
 * Qualified Name:     my.rummyInterface.PanelInformacion
 * JD-Core Version:    0.6.0
 */